package com.lrkj.payfee.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.lrkj.payfee.domain.ChargeNorm;
import com.lrkj.payfee.domain.ComputePayFeeLog;
import com.lrkj.payfee.domain.RoomNorm;
import com.lrkj.payfee.domain.RuleCost;
import com.lrkj.payfee.domain.vo.AdueRecordVo;
import com.lrkj.payfee.vo.BillVo;
import com.lrkj.payfee.vo.ChangeFeeVo;
import com.lrkj.payfee.vo.DemolitionVo;
import com.lrkj.payfee.vo.NormChargeVo;
import org.apache.ibatis.annotations.Param;

/**
 * 常规费用单Service接口
 *
 * @author yajun_ren
 * @date 2021-07-30
 */
public interface IRuleCostService {
    /**
     * 查询常规费用单
     *
     * @param costId 常规费用单ID
     * @return 常规费用单
     */
    public RuleCost selectRuleCostById(String costId);

    /**
     * 查询常规费用单列表
     *
     * @param ruleCost 常规费用单
     * @return 常规费用单集合
     */
    public List<RuleCost> selectRuleCostList(RuleCost ruleCost);

    /**
     * 新增常规费用单
     *
     * @param ruleCost 常规费用单
     * @return 结果
     */
    public int insertRuleCost(RuleCost ruleCost);

    /**
     * 编辑费用
     *
     * @param ruleCost
     * @return
     */
    int edit(List<RuleCost> ruleCost);

    /**
     * 修改常规费用单
     *
     * @param ruleCost 常规费用单
     * @return 结果
     */
    public int updateRuleCost(RuleCost ruleCost);

    /**
     * 批量删除常规费用单
     *
     * @param costIds 需要删除的常规费用单ID
     * @return 结果
     */
    public int deleteRuleCostByIds(String[] costIds);

    /**
     * 删除常规费用单信息
     *
     * @param costId 常规费用单ID
     * @return 结果
     */
    public int deleteRuleCostById(String costId);

    /**
     * 创建常规费用单信息
     *
     * @return 结果
     */
    public int createRuleCost(RuleCost ruleCost);

    /**
     * 批量修改
     */
    public int doSaveList(List<RuleCost> batchBean);


    /**
     * 查询房间费用
     */
    public List<AdueRecordVo> selectAdueRecord(AdueRecordVo adueRecordVo);


    /**
     * 收费单No
     *
     * @param key
     **/
    public String getNo(String key);


    /**
     * 通过抄表记录删除费用单
     * copyId 抄表记录ID
     *
     * @return 结果
     */
    public int deleteRuleCostByCopyId(String[] copyIds);

    //保证金退款
    public int bailRefund(AdueRecordVo adueRecordVo);


    /**
     * 更新结账期间
     **/
    public int updateFiscalPeriod(Map<String, Object> params);

    /***
     *
     * 查询账期内生成的账单
     *
     * */
    List<RuleCost> selectFeeFormByFiscalPeriodList(NormChargeVo normChargeVo);

    //费用管理 改费
    public int changeFee(ChangeFeeVo changeFeeVo);

    //拆费
    public int demolitionFee(DemolitionVo demolitionVo);

    //房间欠费金额
    public BigDecimal roomAmountOwed(String roomId);

    /**
     * 房间账单明细
     * */
    public JSONObject roomBillDetail(String roomId);

    //查询费用单列表
    public List<RuleCost> selectRuleCostIds(List<String> costIds);

    //更新费用单明细
    public int updateAmountOwed(List<RuleCost> ruleCosts);



    /**
     * 根据房屋id查询欠费数量
     * @param roomId
     * @return
     */
    public int arrearageCountByRoomId(String roomId);
}
